<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CryptoAuthLib: atcacert_pem.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CryptoAuthLib
   </div>
   <div id="projectbrief">Microchip CryptoAuthentication Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00218_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">atcacert_pem.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="a00218.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#ifndef ATCACERT_PEM_H</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#define ATCACERT_PEM_H</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="a00218.html#aefb573f85f8692759f6c82587a948d71">   37</a></span>&#160;<span class="preprocessor">#define PEM_CERT_BEGIN &quot;-----BEGIN CERTIFICATE-----&quot;</span></div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="a00218.html#afbe03d95d1d6a651c01d1ef74daa4063">   38</a></span>&#160;<span class="preprocessor">#define PEM_CERT_END   &quot;-----END CERTIFICATE-----&quot;</span></div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="a00218.html#a006df03d5e86c2d586f02362ca66566e">   39</a></span>&#160;<span class="preprocessor">#define PEM_CSR_BEGIN  &quot;-----BEGIN CERTIFICATE REQUEST-----&quot;</span></div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="a00218.html#ad7521d8913a097b0a910d00fdb664210">   40</a></span>&#160;<span class="preprocessor">#define PEM_CSR_END    &quot;-----END CERTIFICATE REQUEST-----&quot;</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a00218.html#abd464bace94353a8ff767e5a9bdc66ce">atcacert_encode_pem</a>(<span class="keyword">const</span> uint8_t* der,</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;                        <span class="keywordtype">size_t</span>         der_size,</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;                        <span class="keywordtype">char</span>*          pem,</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;                        <span class="keywordtype">size_t</span>*        pem_size,</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;                        <span class="keyword">const</span> <span class="keywordtype">char</span>*    header,</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;                        <span class="keyword">const</span> <span class="keywordtype">char</span>*    footer);</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a00218.html#a67998c5401898020391dc6f02b11d2bd">atcacert_decode_pem</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* pem,</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;                        <span class="keywordtype">size_t</span>      pem_size,</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;                        uint8_t*    der,</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                        <span class="keywordtype">size_t</span>*     der_size,</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;                        <span class="keyword">const</span> <span class="keywordtype">char</span>* header,</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                        <span class="keyword">const</span> <span class="keywordtype">char</span>* footer);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a00218.html#a5f893d8f40bc8126a3802ad435bba895">atcacert_encode_pem_cert</a>(<span class="keyword">const</span> uint8_t* der_cert, <span class="keywordtype">size_t</span> der_cert_size, <span class="keywordtype">char</span>* pem_cert, <span class="keywordtype">size_t</span>* pem_cert_size);</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a00218.html#a47e68bdf906458409c7eff1aed0dff3a">atcacert_decode_pem_cert</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* pem_cert, <span class="keywordtype">size_t</span> pem_cert_size, uint8_t* der_cert, <span class="keywordtype">size_t</span>* der_cert_size);</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a00218.html#ab148948a885c6a7c9c95494e48e45cb1">atcacert_encode_pem_csr</a>(<span class="keyword">const</span> uint8_t* der_csr, <span class="keywordtype">size_t</span> der_csr_size, <span class="keywordtype">char</span>* pem_csr, <span class="keywordtype">size_t</span>* pem_csr_size);</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a00218.html#afbccc09407aeb4d7b626b28da120211a">atcacert_decode_pem_csr</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* pem_csr, <span class="keywordtype">size_t</span> pem_csr_size, uint8_t* der_csr, <span class="keywordtype">size_t</span>* der_csr_size);</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;}</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="a00218_html_a5f893d8f40bc8126a3802ad435bba895"><div class="ttname"><a href="a00218.html#a5f893d8f40bc8126a3802ad435bba895">atcacert_encode_pem_cert</a></div><div class="ttdeci">int atcacert_encode_pem_cert(const uint8_t *der_cert, size_t der_cert_size, char *pem_cert, size_t *pem_cert_size)</div><div class="ttdoc">Encode a DER certificate in PEM format.</div><div class="ttdef"><b>Definition:</b> atcacert_pem.c:123</div></div>
<div class="ttc" id="a00218_html_abd464bace94353a8ff767e5a9bdc66ce"><div class="ttname"><a href="a00218.html#abd464bace94353a8ff767e5a9bdc66ce">atcacert_encode_pem</a></div><div class="ttdeci">int atcacert_encode_pem(const uint8_t *der, size_t der_size, char *pem, size_t *pem_size, const char *header, const char *footer)</div><div class="ttdoc">Encode a DER data in PEM format.</div><div class="ttdef"><b>Definition:</b> atcacert_pem.c:5</div></div>
<div class="ttc" id="a00218_html_afbccc09407aeb4d7b626b28da120211a"><div class="ttname"><a href="a00218.html#afbccc09407aeb4d7b626b28da120211a">atcacert_decode_pem_csr</a></div><div class="ttdeci">int atcacert_decode_pem_csr(const char *pem_csr, size_t pem_csr_size, uint8_t *der_csr, size_t *der_csr_size)</div><div class="ttdoc">Extract the CSR certificate bytes from a PEM encoded CSR certificate.</div><div class="ttdef"><b>Definition:</b> atcacert_pem.c:156</div></div>
<div class="ttc" id="a00218_html_ab148948a885c6a7c9c95494e48e45cb1"><div class="ttname"><a href="a00218.html#ab148948a885c6a7c9c95494e48e45cb1">atcacert_encode_pem_csr</a></div><div class="ttdeci">int atcacert_encode_pem_csr(const uint8_t *der_csr, size_t der_csr_size, char *pem_csr, size_t *pem_csr_size)</div><div class="ttdoc">Encode a DER CSR in PEM format.</div><div class="ttdef"><b>Definition:</b> atcacert_pem.c:134</div></div>
<div class="ttc" id="a00218_html_a47e68bdf906458409c7eff1aed0dff3a"><div class="ttname"><a href="a00218.html#a47e68bdf906458409c7eff1aed0dff3a">atcacert_decode_pem_cert</a></div><div class="ttdeci">int atcacert_decode_pem_cert(const char *pem_cert, size_t pem_cert_size, uint8_t *der_cert, size_t *der_cert_size)</div><div class="ttdoc">Decode a PEM certificate into DER format.</div><div class="ttdef"><b>Definition:</b> atcacert_pem.c:145</div></div>
<div class="ttc" id="a00218_html_a67998c5401898020391dc6f02b11d2bd"><div class="ttname"><a href="a00218.html#a67998c5401898020391dc6f02b11d2bd">atcacert_decode_pem</a></div><div class="ttdeci">int atcacert_decode_pem(const char *pem, size_t pem_size, uint8_t *der, size_t *der_size, const char *header, const char *footer)</div><div class="ttdoc">Decode PEM data into DER format.</div><div class="ttdef"><b>Definition:</b> atcacert_pem.c:73</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_26647cdac0a1f8c717d44b4eb3b4ec89.html">atcacert</a></li><li class="navelem"><a class="el" href="a00218.html">atcacert_pem.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
